class CollectionTransferRecordModel {
  List<CollectionTransferRecordItem>? list;
  int? pageNum;
  int? pageSize;
  int? total;
  int? totalPage;

  CollectionTransferRecordModel({
    this.list,
    this.pageNum,
    this.pageSize,
    this.total,
    this.totalPage,
  });

  CollectionTransferRecordModel.fromJson(Map<String, dynamic> json) {
    if (json["list"] is List) {
      list =
          json["list"] == null
              ? null
              : (json["list"] as List)
                  .map((e) => CollectionTransferRecordItem.fromJson(e))
                  .toList();
    }
    if (json["pageNum"] is num) {
      pageNum = (json["pageNum"] as num).toInt();
    }
    if (json["pageSize"] is num) {
      pageSize = (json["pageSize"] as num).toInt();
    }
    if (json["total"] is num) {
      total = (json["total"] as num).toInt();
    }
    if (json["totalPage"] is num) {
      totalPage = (json["totalPage"] as num).toInt();
    }
  }

  static List<CollectionTransferRecordModel> fromList(
    List<Map<String, dynamic>> list,
  ) {
    return list.map(CollectionTransferRecordModel.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    if (list != null) {
      _data["list"] = list?.map((e) => e.toJson()).toList();
    }
    _data["pageNum"] = pageNum;
    _data["pageSize"] = pageSize;
    _data["total"] = total;
    _data["totalPage"] = totalPage;
    return _data;
  }
}

class CollectionTransferRecordItem {
  String? collectionName;
  String? coverImageUrl;
  String? createTime;
  String? fromAddress;
  String? toAddress;
  String? tokenId;
  String? transferType;
  String? txHash;

  CollectionTransferRecordItem({
    this.collectionName,
    this.coverImageUrl,
    this.createTime,
    this.fromAddress,
    this.toAddress,
    this.tokenId,
    this.transferType,
    this.txHash,
  });

  CollectionTransferRecordItem.fromJson(Map<String, dynamic> json) {
    if (json["collectionName"] is String) {
      collectionName = json["collectionName"];
    }
    if (json["coverImageUrl"] is String) {
      coverImageUrl = json["coverImageUrl"];
    }
    if (json["createTime"] is String) {
      createTime = json["createTime"];
    }
    if (json["fromAddress"] is String) {
      fromAddress = json["fromAddress"];
    }
    if (json["toAddress"] is String) {
      toAddress = json["toAddress"];
    }
    if (json["tokenId"] is String) {
      tokenId = json["tokenId"];
    }
    if (json["transferType"] is String) {
      transferType = json["transferType"];
    }
    if (json["txHash"] is String) {
      txHash = json["txHash"];
    }
  }

  static List<CollectionTransferRecordItem> fromList(
    List<Map<String, dynamic>> list,
  ) {
    return list.map(CollectionTransferRecordItem.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["collectionName"] = collectionName;
    _data["coverImageUrl"] = coverImageUrl;
    _data["createTime"] = createTime;
    _data["fromAddress"] = fromAddress;
    _data["toAddress"] = toAddress;
    _data["tokenId"] = tokenId;
    _data["transferType"] = transferType;
    _data["txHash"] = txHash;
    return _data;
  }
}
